import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { ClockCircleOutlined } from '@ant-design/icons-vue';

export const columns: BasicColumn[] = [
  {
    title: '定时',
    dataIndex: 'isTiming',
    width: 50,
    ellipsis: true,
    resizable: true,
    customRender: ({ text }) => {
      if (text) {
        return h(ClockCircleOutlined);
      }
    },
  },
  {
    title: '发件人',
    dataIndex: 'sender',
    width: 100,
    ellipsis: true,
    resizable: true,
    slots: { customRender: 'sender' },
  },
  {
    title: '主题',
    dataIndex: 'subject',
    width: 120,
    ellipsis: true,
    resizable: true,
    slots: { customRender: 'subject' },
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 150,
    ellipsis: true,
    resizable: true,
  },
  {
    title: '待发送时间',
    dataIndex: 'sendTime',
    width: 150,
    ellipsis: true,
    resizable: true,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'what',
    label: '',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const formSchema: FormSchema[] = [];
